<template>
     <div class="style1">
        <h2>班级名字：{{name}}</h2>
        <h2>班级人数：{{count}}</h2>
        <button @click="showInfo()">显示班级信息</button>
    </div>
</template>

<script>
    // VueComponent
    export default {
        name: 'Banji',
        data() {
            return {
                name: 'Java2207',
                count: 30
            }
        },
        methods: {
            showBanjiInfo() {
                alert(this.name + ' : ' + this.count);
            }
        }
    }
</script>

<style>
    .style1{
        background-color: green;
    }
</style>